<template>
  <div v-if="detail.status == -2" @click="sendSkipToArticle"  class="mw-column-center-style" style="width:3.45rem;height:1.73rem;margin:0.15rem;justify-content: center;background-color: #F5F5F5">
    <img src="/static/has_deleted.png" style="width: 0.44rem;height:0.54rem;object-fit: cover"/>
    <div class="mw-third-text-color" style="font-size: 0.13rem;margin-top:0.15rem;">作者已删除</div>
  </div>
  <div v-else @click="sendSkipToArticle" class="mw-column-style" style="width:3.45rem;padding:0.15rem;">
    <div @click.stop="sendSkipToUserPage" v-if="detail.hasOwnProperty('user')" class="mw-row-style" style="align-items: center;margin-bottom: 0.13rem;">
      <div style="height:0.32rem;width:0.32rem;position: relative">
        <img class="mw-avatar-style" :src="detail.user.avatar" style="height:100%;width:100%;  border-radius: 50%;object-fit:cover;position: absolute;left:0;"/>
      </div>
      <div class="mw-column-style" style="justify-content: center;height:0.32rem;margin-left:0.12rem;">
        <div class="mw-single-line mw-first-text-color" style="font-size: 0.13rem;margin-bottom: 0.04rem">{{detail.user.name}}</div>
      </div>
    </div>
    <img :src="detail.cover_image" style="width:3.45rem;height:1.73rem;object-fit:cover;border-radius: 0.08rem;margin-bottom: 0.1rem;"/>
    <div class="mw-n-line mw-first-text-color " style="font-size:0.17rem;width: 100%;margin-bottom:0.1rem;">{{detail.title}}</div>
    <div class="mw-row-spacebetween-style">
      <div class="mw-row-style" style="align-items: center;font-size: 0.11rem;">
        <img src="/static/read_eye.png" style="margin-right:0.04rem;height:0.16rem;width:0.16rem;object-fit:cover;"/>
        <div class="mw-third-text-color" style="margin-right: 0.1rem">{{detail.views_total < 10000 ? detail.views_total : (Math.floor(detail.views_total/10000 * 10) / 10 + 'w')}}</div>
        <img src="/static/zan_show.png" style="margin-right:0.04rem;height:0.16rem;width:0.16rem;object-fit:cover;"/>
        <div class="mw-third-text-color" style="margin-right: 0.1rem">{{detail.likes_total < 10000 ? detail.likes_total : (Math.floor(detail.likes_total/10000 * 10) / 10 + 'w')}}</div>
      </div>
      <div class="mw-third-text-color" style="font-size: 0.11rem;">{{detail.published_time}}</div>
    </div>
  </div>
</template>
<script>
  import utils from '../utils'
  import httputil from '../httputil'
  export default {
    props: ['detail','enter'],
    data() {
      return {

      }
    },
    mounted() {

    },
    computed: {},
    methods: {
      sendSkipToArticle(){
//        this.$emit('receiveSkipToArticle',this.detail.id)
        this.$vuet.getModule(this.enter).needFetch = false
        this.$router.push({name: 'contentdetail', query: {id: this.detail.id}})
      },
      sendSkipToUserPage(){
        this.$vuet.getModule(this.enter).needFetch = false
        this.$router.push({name: 'userpage', query: {id: this.detail.user.id}})
      },
    }
  }

</script>
<style>

</style>
